package cn.texous.demo.dnw.config;

import cn.texous.demo.dnw.interceptor.RequestAnalysisInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * insert description here
 *
 * @author Showa.L
 * @since 2019/8/21 13:47
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private RequestAnalysisInterceptor requestAnalysisInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(requestAnalysisInterceptor).addPathPatterns("/**");
    }
}
